// todo 1. 安装redux yarn add redux
// todo 2. 导入createStore

import { combineReducers, createStore } from 'redux'
import goodReducer from './modules/goodsReducer'
import userReducer from './modules/userReducer'

// redcer => dispatch => action => reducer =>修改数据

// 需要将多个reducer 合成一个根reducer
// ! 使用combineReducers  合并reducer后 我们的状态也合并到一个打的对象中, 将来使用数据时要注意
const rootReducer = combineReducers({
  user: userReducer,
  goods: goodReducer,
})
export default createStore(rootReducer)
